package com.hwadee.caixiang.service.impl;

import java.util.List;


import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.hwadee.caixiang.dao.ProductMapper;
import com.hwadee.caixiang.entity.Product;
import com.hwadee.caixiang.service.ProductService;

@Service("productService")
public class ProductServiceImpl implements ProductService {
	
	@Autowired
	private ProductMapper productMapper;

	@Override
	public Product productfindByPid(Integer pid) {
		return productMapper.productfindByPid(pid);
	}

	@Override
	public List<Product> products() {
		return productMapper.findAllProducts();
	}
	@Override
	public List<Product> productsOfSearch(String searchname) {
		return productMapper.findProductBySearch(searchname);
	}
}
